﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace ChineseCheselrm1
{
    
    /// <summary>
    /// 游戏时间类
    /// </summary>
    class GameSide
    {
        /// <summary>
        /// 定义下一个走棋方
        /// </summary>
        public bool NextIsBlack { get; set; }

        /// <summary>
        /// 初始化
        /// </summary>
        public GameSide()
        {
            NextIsBlack = false;
        }

        //定义游戏高度
        private const int GameHeight = 1100;
        //定义游戏宽度
        private const int GameWidth = 1000;

        /// <summary>
        /// 绘制当前游戏场景
        /// </summary>
        /// <param name="g"></param>
        /// <param name="size"></param>
        public void Draw(Graphics g, Size size)
        {
            //使用二次绘图
            Image img = new Bitmap(GameWidth, GameHeight);
            Graphics _g = Graphics.FromImage(img);
            Rectangle rec = new Rectangle(new Point(0, 0), new Size(GameWidth, GameHeight));
            //画背景图
            _g.DrawImage(Properties.Resources.backgrand, rec);
            //画将/帅的图表示当前的这一方
            Rectangle recKing = new Rectangle(150, 200, 700, 700);
            if (NextIsBlack == true)
            {
                //画黑将
                _g.DrawImage(Properties.Resources.黑帅, recKing);
            }
            else
            {
                //画红帅
                _g.DrawImage(Properties.Resources.红帅, recKing);
            }
            //书写“当前走棋方”
            Font font = new Font("楷体", (float)(100), FontStyle.Regular, GraphicsUnit.Pixel);
            SolidBrush fontBrush = new SolidBrush(Color.Black);
            _g.DrawString("当前走棋方：", font, fontBrush, new Point(70, 80));
            g.DrawImage(img, new Rectangle(new Point(0, 0), size));
           
        }
    }
}
